//auto gen by paipai.java.augogen ver 154
//author floatman
#ifndef _ORGANIZATIONAO_ORGANIZATION_H_
#define _ORGANIZATIONAO_ORGANIZATION_H_

#include <stdint.h>
#include <string>
#include <iostream>
#include "app_platform/help_macros.h"
#include "app_platform/intf_service.h"
#include "intf_organizationao.h"

#include "library/basic/singleton_t.h"
#include "library/basic/sync_lock.h"
#include "c2cent/library/log/CWTimeElf3.h"

#include <set>
#include <map>
#include <vector>
#include "erp/organization/po/organizationfilterpo_organization.h"
#include "erp/organization/po/branchpo_organization.h"

HEADER_SELF_DEFINE_START
/**
*  请在这里增加自定义包含的头文件，否则无法合并代码
**/
HEADER_SELF_DEFINE_END

namespace erp
{
namespace organization
{
namespace ao
{

#define ORGANIZATIONAO_SERVICE_VERSION "ERP_ORGANIZATION_AO___ORGANIZATIONAO__SERVICE_VERSION__1.0 2013-10-23 11:04:16"
const std::string ORGANIZATIONAO_SERVICE_NOUSE = ORGANIZATIONAO_SERVICE_VERSION;

SERVICE class COrganizationAo : public IOrganizationAo{
public:
		COrganizationAo(enum DeployMethod method = DEPLOY_STANDALONE);
		~COrganizationAo();
		 void Reset();
		static int Initialize(IUserDefineCntl* pCntl = NULL);

public:
	 /**
	 *
	 *   添加/修改分支机构；传入分支机构ID不为0时则进行修改，反之则进行添加；不能进行逻辑删除
	 *
	 */
	EXPORT(0xC04D1801) uint32_t ModifyBranch(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::organization::po::CBranchPo& oBranch,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 erp::organization::po::CBranchPo& oBranchBack,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   删除分支机构（逻辑）
	 *
	 */
	EXPORT(0xC04D1802) uint32_t DeleteBranch(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const std::set<uint64_t> & setBranchId,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::map<uint64_t,uint32_t> & mapErrorCode,
		 std::map<uint64_t,std::string> & mapErrorMsg,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   根据分支机构ID批量获取分支机构信息
	 *
	 */
	EXPORT(0xC04D1803) uint32_t GetBranch(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const std::set<uint64_t> & setBranchId,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 std::map<uint64_t,uint32_t> & mapErrorCode,
		 std::map<uint64_t,std::string> & mapErrorMsg,
		 std::map<uint64_t,erp::organization::po::CBranchPo> & mapBranch,
		 std::string& strOutReserve
		);

	 /**
	 *
	 *   根据过滤条件查询支机构列表信息
	 *
	 */
	EXPORT(0xC04D1804) uint32_t FindBranch(
		 const CCntlInfo& rCntlInfo,
		 const std::string& strMachineKey,
		 const std::string& strSource,
		 uint32_t dwSceneId,
		 uint32_t dwOption,
		 const erp::organization::po::COrganizationFilterPo& oFilter,
		 const std::string& strInReserve,
		 std::string& strErrmsg,
		 uint32_t& dwTotal,
		 std::vector<erp::organization::po::CBranchPo> & vecBranch,
		 std::string& strOutReserve
		);

SECTION_SELF_DEFINE_START
/**
* 请在这里增加自定义的成员变量和函数，否则无法合并代码
**/
SECTION_SELF_DEFINE_END

private:
	enum DeployMethod m_method;
};

}
}
}

#endif /* _ORGANIZATIONAO_ORGANIZATION_H_ */